xen.git
17 years agoserial: Fix IRQ enable/disable in tx interrupt handler.
Keir Fraser [Mon, 27 Oct 2008 11:27:31 +0000 (11:27 +0000)]
serial: Fix IRQ enable/disable in tx interrupt handler.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86_32: Lock in map_domain_page() may be taken with IRQs disabled, and
Keir Fraser [Mon, 27 Oct 2008 10:49:20 +0000 (10:49 +0000)]
x86_32: Lock in map_domain_page() may be taken with IRQs disabled, and
hence must *always* disable IRQs.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoAdd 2 more permissions to the XSM/Flask default policy.
Keir Fraser [Mon, 27 Oct 2008 10:29:39 +0000 (10:29 +0000)]
Add 2 more permissions to the XSM/Flask default policy.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agox86: relax restrictions on reserved bits in L3 for 32on64 x86 guests
Keir Fraser [Mon, 27 Oct 2008 10:08:48 +0000 (10:08 +0000)]
x86: relax restrictions on reserved bits in L3 for 32on64 x86 guests

A 32on64 guest cannot copy an existing pinned L3 entry to use as a new
L3 because COMPAT_L3_DISALLOW_MASK contains bits which are added to L3
entries by adjust_guest_l3e (U/S & R/W) or by the hardware (A & D).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
17 years agoCpufreq statistic update for SW_ANY coordination
Keir Fraser [Mon, 27 Oct 2008 10:06:58 +0000 (10:06 +0000)]
Cpufreq statistic update for SW_ANY coordination

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
17 years agoFix xm scsi-attach/detach/list for inactive managed domains
Keir Fraser [Mon, 27 Oct 2008 10:03:17 +0000 (10:03 +0000)]
Fix xm scsi-attach/detach/list for inactive managed domains

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agox86: Enable spinlock debugging earlier during boot.
Keir Fraser [Thu, 23 Oct 2008 14:38:52 +0000 (15:38 +0100)]
x86: Enable spinlock debugging earlier during boot.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Dom0 builder doesn't need to disable IRQs while running on dom0 pagetables.
Keir Fraser [Thu, 23 Oct 2008 14:38:27 +0000 (15:38 +0100)]
x86: Dom0 builder doesn't need to disable IRQs while running on dom0 pagetables.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Dom0 builder must run on a valid GDT at all times.
Keir Fraser [Thu, 23 Oct 2008 14:34:27 +0000 (15:34 +0100)]
x86: Dom0 builder must run on a valid GDT at all times.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRemove accidentally checked-in xenpmd binary.
Keir Fraser [Thu, 23 Oct 2008 14:23:15 +0000 (15:23 +0100)]
Remove accidentally checked-in xenpmd binary.

17 years agohpet cpuidle: Observe IRQ-safe locking protocol.
Keir Fraser [Thu, 23 Oct 2008 11:01:03 +0000 (12:01 +0100)]
hpet cpuidle: Observe IRQ-safe locking protocol.

Otherwise, may encounter deadlock.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agospinlock: Add debug-build checks for IRQ-safe spinlocks.
Keir Fraser [Thu, 23 Oct 2008 10:53:52 +0000 (11:53 +0100)]
spinlock: Add debug-build checks for IRQ-safe spinlocks.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, hvm: Move return-to-guest timer and interrupt cranking logic
Keir Fraser [Thu, 23 Oct 2008 10:40:59 +0000 (11:40 +0100)]
x86, hvm: Move return-to-guest timer and interrupt cranking logic
outside of IRQ-safe context. This allows us to safely take
non-IRQ-safe spinlocks.

The drawback is that {vmx,svm}_intr_assist() now races new event
notifications delivered by IRQ or IPI. We close down this race by
having vcpu_kick() send a dummy softirq -- this gets picked up in
IRQ-sage context and will cause retry of *_intr_assist(). We avoid
delivering the softirq where possible by avoiding it when we are
running in the non-IRQ context of the VCPU to be kicked.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxenpmd: Fix makefile for 'make install'.
Keir Fraser [Thu, 23 Oct 2008 10:20:44 +0000 (11:20 +0100)]
xenpmd: Fix makefile for 'make install'.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agohvmloader: Remove unneeded legacy flag from FADT flags field.
Keir Fraser [Thu, 23 Oct 2008 10:18:34 +0000 (11:18 +0100)]
hvmloader: Remove unneeded legacy flag from FADT flags field.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
rHG: changed tools/firmware/hvmloader/acpi/static_tables.c

17 years agoXen power management daemon patch.
Keir Fraser [Thu, 23 Oct 2008 10:17:25 +0000 (11:17 +0100)]
Xen power management daemon patch.

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
17 years agox86, smpboot: A few code cleanups.
Keir Fraser [Wed, 22 Oct 2008 15:47:44 +0000 (16:47 +0100)]
x86, smpboot: A few code cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRemove duplicated __cacheline_aligned attribute from irq_desc arrays
Keir Fraser [Wed, 22 Oct 2008 15:41:33 +0000 (16:41 +0100)]
Remove duplicated __cacheline_aligned attribute from irq_desc arrays

Remove duplicated __cacheline_aligned attribute, as it's
already included in type declaration.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
17 years agoRemove unused old xmalloc.c file.
Keir Fraser [Wed, 22 Oct 2008 15:39:37 +0000 (16:39 +0100)]
Remove unused old xmalloc.c file.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Remove needless IRQ critical section from init_xen_time().
Keir Fraser [Wed, 22 Oct 2008 14:11:54 +0000 (15:11 +0100)]
x86: Remove needless IRQ critical section from init_xen_time().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agospinlock: Add assertions for lock_irq() variants.
Keir Fraser [Wed, 22 Oct 2008 14:07:30 +0000 (15:07 +0100)]
spinlock: Add assertions for lock_irq() variants.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoDefine spin_barrier_irq() for IRQ-safe spinlocks, and use it for virq_lock.
Keir Fraser [Wed, 22 Oct 2008 14:06:01 +0000 (15:06 +0100)]
Define spin_barrier_irq() for IRQ-safe spinlocks, and use it for virq_lock.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, hvm: Allow 100us periodic virtual timers
Keir Fraser [Wed, 22 Oct 2008 11:08:16 +0000 (12:08 +0100)]
x86, hvm: Allow 100us periodic virtual timers

Adjust vpt and hpet minimum period (for timers) from 900us to 100us to
be able to pass Windows 2008 compatibility tests.

Signed-off-by: Peter Johnston <peter.johnston@citrix.com>
17 years agoPort HPET device model to vpt timer subsystem
Keir Fraser [Wed, 22 Oct 2008 11:04:32 +0000 (12:04 +0100)]
Port HPET device model to vpt timer subsystem

The current hpet implementation runs a one-shot xen timer for each
hpet timer whenever the main counter is enabled regardless of whether
or not the individual hpet timers are enabled.  When the timer fires,
if it is enabled the interrupt is routed to the guest.  If the hpet
timer is periodic, a new one-shot timer is set, for NOW()+period.
There are a number of problems with this the most significant is guest
time drift.  Windows does not read the hardware clock to verify time,
it depends on timer interrupts firing at the expected interval.  The
existing implementation queues a new one-shot timer each time it fires
and does not allow for a difference between NOW() and the time the
timer was expected to fire, causing drift.  Also there is
no allowance for lost ticks. This modification changes HPET to use the
Virtual Platform Timer (VPT) and, for periodic timers, to use periodic
timers.  The VPT ensures an interrupt is delivered to the guest for
each period that elapses, plus, its use of xen periodic timers ensures
no drift.

Signed-off-by: Peter Johnston <peter.johnston@citrix.com>
17 years agoEPT: tidy exception handler to give more useful errors
Keir Fraser [Wed, 22 Oct 2008 10:59:19 +0000 (11:59 +0100)]
EPT: tidy exception handler to give more useful errors

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agox86, hap: Track max_mapped_pfn better when using 2MB p2m mappings.
Keir Fraser [Wed, 22 Oct 2008 10:58:20 +0000 (11:58 +0100)]
x86, hap: Track max_mapped_pfn better when using 2MB p2m mappings.

The test for when to increase it was not quite right; also on EPT
the value it was set to didn't count the top 511 frames.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoFix guest_physmap_add_entry sanity checking logic
Keir Fraser [Wed, 22 Oct 2008 10:56:44 +0000 (11:56 +0100)]
Fix guest_physmap_add_entry sanity checking logic

Fix the logic of the p->m and m->p mapping sanity checks and fixup in
guest_physmap_add_entry().

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
17 years agoblktap: re-enable O_DIRECT in block_qcow.c
Keir Fraser [Wed, 22 Oct 2008 10:55:33 +0000 (11:55 +0100)]
blktap: re-enable O_DIRECT in block_qcow.c

Turns out that only two reads and writes in block-qcow.c need to be
fixed to work correctly with O_DIRECT.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agoSimplify set_px_info hypercall 32-on-64 compatibility shim.
Keir Fraser [Wed, 22 Oct 2008 10:53:51 +0000 (11:53 +0100)]
Simplify set_px_info hypercall 32-on-64 compatibility shim.

Mark processor_px as 'checking' and translate handle to simplify
actual code doing in the translation.
(According to Jan Beulich's suggestion)

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
17 years ago[IA64] Add head files and helper functions for VTD/ia64
Isaku Yamahata [Wed, 22 Oct 2008 08:20:15 +0000 (17:20 +0900)]
[IA64] Add head files and helper functions for VTD/ia64

Add head files and helper functions for VTD/ia64.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
17 years ago[IA64]: update ia64 px info transfer corresponding to x86 px info update.
Isaku Yamahata [Wed, 22 Oct 2008 03:41:52 +0000 (12:41 +0900)]
[IA64]: update ia64 px info transfer corresponding to x86 px info update.

update ia64 px info transfer corresponding to x86 px info update.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
17 years ago[IA64] Add hypercalls needed for VTD
Isaku Yamahata [Wed, 22 Oct 2008 03:40:06 +0000 (12:40 +0900)]
[IA64] Add hypercalls needed for VTD

Add hypercalls needed for VTD.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
17 years agomerge with xen-unstable.hg
Isaku Yamahata [Wed, 22 Oct 2008 02:46:55 +0000 (11:46 +0900)]
merge with xen-unstable.hg

17 years ago[IA64] fix compilation error of xen/common/spinlock.c
Isaku Yamahata [Wed, 22 Oct 2008 02:38:22 +0000 (11:38 +0900)]
[IA64] fix compilation error of xen/common/spinlock.c

This patch fixes the error in the x86 tree.
> spinlock.c: In function _spin_lock_recursive:
> spinlock.c:59: error: dereferencing pointer to incomplete type

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoia64: Some fixes after spinlock implementation changes.
Keir Fraser [Tue, 21 Oct 2008 17:00:21 +0000 (18:00 +0100)]
ia64: Some fixes after spinlock implementation changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, shadow: shadow_page_info must be same size as page_info.
Keir Fraser [Tue, 21 Oct 2008 13:15:11 +0000 (14:15 +0100)]
x86, shadow: shadow_page_info must be same size as page_info.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Move some code out of IRQ-disabled section of context switch path.
Keir Fraser [Tue, 21 Oct 2008 13:14:37 +0000 (14:14 +0100)]
x86: Move some code out of IRQ-disabled section of context switch path.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, irq: No synamic memory allocation with IRQs disabled.
Keir Fraser [Tue, 21 Oct 2008 13:13:54 +0000 (14:13 +0100)]
x86, irq: No synamic memory allocation with IRQs disabled.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoUse hvm_dirq_assist() to replace {vmx,svm}_dirq_assist().
Keir Fraser [Tue, 21 Oct 2008 10:44:39 +0000 (11:44 +0100)]
Use hvm_dirq_assist() to replace {vmx,svm}_dirq_assist().
Do not compile some IA64 MSI-related parts.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoxend: Fix and clean up vscsi_util.py and other files
Keir Fraser [Tue, 21 Oct 2008 10:43:21 +0000 (11:43 +0100)]
xend: Fix and clean up vscsi_util.py and other files

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agotimer: No dynamic memory allocation with IRQs disabled.
Keir Fraser [Tue, 21 Oct 2008 10:39:57 +0000 (11:39 +0100)]
timer: No dynamic memory allocation with IRQs disabled.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Avoid dynamic memory allocation during AP startup.
Keir Fraser [Tue, 21 Oct 2008 10:39:22 +0000 (11:39 +0100)]
x86: Avoid dynamic memory allocation during AP startup.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agopv-on-hvm: Avoid rwlock livelock on save/restore.
Keir Fraser [Tue, 21 Oct 2008 09:04:40 +0000 (10:04 +0100)]
pv-on-hvm: Avoid rwlock livelock on save/restore.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix ioapic_rte_to_remap_entry() on IA64.
Keir Fraser [Tue, 21 Oct 2008 08:53:34 +0000 (09:53 +0100)]
Fix ioapic_rte_to_remap_entry() on IA64.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoAdd print info for ACPI _PCT and _PPC
Keir Fraser [Tue, 21 Oct 2008 08:49:19 +0000 (09:49 +0100)]
Add print info for ACPI _PCT and _PPC

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
17 years agoUpdate cpufreq statistic protection
Keir Fraser [Tue, 21 Oct 2008 08:48:56 +0000 (09:48 +0100)]
Update cpufreq statistic protection

For struct pm_px, there are 3 pointer: pxpt, pt, trans_pt.
Partly free pointer 'pt' and 'trans_pt' will result in little memory
leak, and what is more, will result in protection issue when user
access px statistic info through libxc.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
17 years agoAdd protection for xenpm access power management info
Keir Fraser [Tue, 21 Oct 2008 08:48:08 +0000 (09:48 +0100)]
Add protection for xenpm access power management info

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
17 years agox86: Adapt 32b guest os to 64b hypervisor platform_hypercall compatibility
Keir Fraser [Tue, 21 Oct 2008 08:47:33 +0000 (09:47 +0100)]
x86: Adapt 32b guest os to 64b hypervisor platform_hypercall compatibility

Changeset 18552 (19b0a4f91712) move px transfer logic from
platform_hypercall.c to a common file to support both x86 and
ia64. However, it involves 32b guest os to 64b hypervisor (x86)
compatible issue. This patch fix the compatible issue, and make
set_px_pminfo() re-used by ia64 and x86 (32b guest os to 64b
hypervisor, and 64b guest os to 64b hypervisor).

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
17 years agox86, spinlock: Always inline raw spinlock functions.
Keir Fraser [Mon, 20 Oct 2008 16:45:36 +0000 (17:45 +0100)]
x86, spinlock: Always inline raw spinlock functions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, spinlock: Get rid of .text.lock out-of-line section.
Keir Fraser [Mon, 20 Oct 2008 16:17:55 +0000 (17:17 +0100)]
x86, spinlock: Get rid of .text.lock out-of-line section.

We don't care about code bloat now that spinlock operations are not
inlined into callers. This will make backtraces easier to read.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agospinlock: Modify recursive spinlock definitions to support up to 4095 CPUs.
Keir Fraser [Mon, 20 Oct 2008 16:16:45 +0000 (17:16 +0100)]
spinlock: Modify recursive spinlock definitions to support up to 4095 CPUs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Add TLB flushing to HAP p2m changes
Keir Fraser [Mon, 20 Oct 2008 15:49:25 +0000 (16:49 +0100)]
x86: Add TLB flushing to HAP p2m changes

Removing an MFN from the p2m requires it to be flushed from the
guest's TLBs on HAP, like we do when we're using shadows.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoClean up spinlock operations and compile as first-class functions.
Keir Fraser [Mon, 20 Oct 2008 15:48:17 +0000 (16:48 +0100)]
Clean up spinlock operations and compile as first-class functions.

This follows modern Linux, since apparently outlining spinlock
operations does not slow down execution. The cleanups will also allow
more convenient addition of diagnostic code.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovmx: avoid taking locks with irqs disabled
Keir Fraser [Mon, 20 Oct 2008 14:31:54 +0000 (15:31 +0100)]
vmx: avoid taking locks with irqs disabled

Shuffle the bits of the vmexit handler that run with EFLAGS.IF == 0 up
to the top.  Otherwise we end up calling spin_lock() with interrupts
disabled, which can deadlock against the time-synchronization
rendezvous code.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agox86: add movnti emulation
Keir Fraser [Mon, 20 Oct 2008 14:22:58 +0000 (15:22 +0100)]
x86: add movnti emulation

Linux added the use of movnti for copying from user to kernel space in
certain cases, and as per reports we got this may happen with the
destination being in MMIO.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoVT-d: correct allocation failure checks
Keir Fraser [Mon, 20 Oct 2008 14:19:39 +0000 (15:19 +0100)]
VT-d: correct allocation failure checks

Checking the return value of map_domain_page() (and hence
map_vtd_domain_page()) against NULL is pointless, checking the return
value of alloc_domheap_page() (and thus alloc_pgtable_maddr()) is
mandatory, however.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agodocs: Update XenAPI document for pvSCSI
Keir Fraser [Mon, 20 Oct 2008 14:18:09 +0000 (15:18 +0100)]
docs: Update XenAPI document for pvSCSI

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoxend: fix setting vcpus > VCPUs_max
Keir Fraser [Mon, 20 Oct 2008 14:17:24 +0000 (15:17 +0100)]
xend: fix setting vcpus > VCPUs_max

From reading xend code related to changing number of vcpus it appears
setting the number of vcpus to a value greater than VCPUs_max is not
allowed on a running domain.  This restriction is not honored by
setVCpuCount() in XendDomainInfo.py.  Attached patch makes
setVCpuCount() fail if vcpus > VCPUs_max and domain is running.

Also, I think the changes should be reflected in managed config of
running domain if in fact the domain is managed - so unconditionally
call managed_config_save().

BTW, the original code is rather confusing.  Essentially the same
actions are taken regardless if self.info['VCPUs_max'] > vcpus, just
the order of invocation is changed.  But this doesn't seem to matter
since self.info['VCPUs_live'] is not subsequently used.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agoAdd some necessary files to build IA64 VT-d.
Keir Fraser [Mon, 20 Oct 2008 14:15:19 +0000 (15:15 +0100)]
Add some necessary files to build IA64 VT-d.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agovtd: make the xen_in_range/tboot_in_range checkings also work for IA64.
Keir Fraser [Mon, 20 Oct 2008 14:14:55 +0000 (15:14 +0100)]
vtd: make the xen_in_range/tboot_in_range checkings also work for IA64.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoDefine a macro IO_APIC_ID() for x86.
Keir Fraser [Mon, 20 Oct 2008 14:13:50 +0000 (15:13 +0100)]
Define a macro IO_APIC_ID() for x86.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoiommu: make some functions (mainly MSI-related) dummy on IA64 for now.
Keir Fraser [Mon, 20 Oct 2008 14:13:02 +0000 (15:13 +0100)]
iommu: make some functions (mainly MSI-related) dummy on IA64 for now.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoAdd a new file xen/include/xen/hvm/irq.h to share common definitions.
Keir Fraser [Mon, 20 Oct 2008 14:11:41 +0000 (15:11 +0100)]
Add a new file xen/include/xen/hvm/irq.h to share common definitions.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoNMI watchdog: don't try to run too slow.
Keir Fraser [Mon, 20 Oct 2008 14:11:19 +0000 (15:11 +0100)]
NMI watchdog: don't try to run too slow.

The way MSR writes of performance counters works means that Intel
CPUs running faster than about 2.1GHz can't set the NMI timer to 1Hz.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoblktap: Handle qcow backing files correctly.
Keir Fraser [Mon, 20 Oct 2008 14:08:24 +0000 (15:08 +0100)]
blktap: Handle qcow backing files correctly.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agoxend: Stub out vscsi_get_scsidevices() until issues are addressed.
Keir Fraser [Mon, 20 Oct 2008 14:05:48 +0000 (15:05 +0100)]
xend: Stub out vscsi_get_scsidevices() until issues are addressed.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoNMI watchdog: use new counter on Core/Core2 CPUs
Keir Fraser [Fri, 17 Oct 2008 13:15:37 +0000 (14:15 +0100)]
NMI watchdog: use new counter on Core/Core2 CPUs

The old CPU_CLK_UNHALTED performance counter no longer runs on Core or
Core2 CPUs.  Use the new CPU_CLK_UNHALTED.CORE_P one.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agosvm: Check exitcode for NRIP validity only in debug builds.
Keir Fraser [Fri, 17 Oct 2008 11:12:50 +0000 (12:12 +0100)]
svm: Check exitcode for NRIP validity only in debug builds.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovtd: code cleanup
Keir Fraser [Fri, 17 Oct 2008 11:04:11 +0000 (12:04 +0100)]
vtd: code cleanup

Remove iommu_page_mapping/unmapping, which are redundant because
intel_iommu_map_page/unmap_page can handle their functions.

Correct IRTA_REG_EIMI_SHIFT to IRTA_REG_EIME_SHIFT.

and also remove useless declarations in iommu.c

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoEnable PCI serial devices for console messages
Keir Fraser [Fri, 17 Oct 2008 11:00:25 +0000 (12:00 +0100)]
Enable PCI serial devices for console messages

The basic issue is that some PCI serial devices use a non-standard
crystal to control the baud rate divisor.  This patch enhances the
`com' parameter to enable you to specify the crystal frequency used by
the serial device. Since this parameter already allows you to specify
I/O address and IRQ this is all that is needed to get a PCI serial
device to work.  With this patch the `com' parameter is now defined
as:
        comN=BBB[/CCC][,NPS[,III[,IRQ]]]

Where `CCC' is the crystal frequency. Note that if you specify 0 for
`IRQ' Xen will run the serial device in polled mode, obviating the
need for interrupts (an advantage since this is the only way I was
able to get my PCI serial device to work).

As an example, I am using the xen boot command:

        kernel /xen.gz com1=3D115200,8n1,0xe880/921600,0
        console=3Dcom1

Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years ago[IA64] clean up of xenpage.h
Isaku Yamahata [Fri, 17 Oct 2008 09:24:57 +0000 (18:24 +0900)]
[IA64] clean up of xenpage.h

remove nasty undefs in xenpage.h.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] clean up ioports_{permit, deny}_access()
Isaku Yamahata [Fri, 17 Oct 2008 09:16:05 +0000 (18:16 +0900)]
[IA64] clean up ioports_{permit, deny}_access()

eliminate code duplication in those functions
by introducing helper functions.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] Change ioports_permit_access interface().
Isaku Yamahata [Fri, 17 Oct 2008 08:40:15 +0000 (17:40 +0900)]
[IA64] Change ioports_permit_access interface().

use VTD to assing device, guest port may not be equal to host port.
Change ioports_permit_access interface to get guest pseudo physical
address.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
17 years ago[IA64] make virt_to_maddr() to support both cached/uncached identity mapped area.
Isaku Yamahata [Fri, 17 Oct 2008 06:33:03 +0000 (15:33 +0900)]
[IA64] make virt_to_maddr() to support both cached/uncached identity mapped area.

The significant 8 bits of va are used by Xen,
such as 0xf2 is used as uncache mapping.

In function ioports_permit_access,
 mach_start = mmio_start | __pa(space->mmio_base);
Mach_start gets wrong physical address.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
17 years agoNextRIPS support for forthcoming AMD processors
Keir Fraser [Thu, 16 Oct 2008 17:45:48 +0000 (18:45 +0100)]
NextRIPS support for forthcoming AMD processors

Future versions of AMD processors will support a feature called
NextRIPS or Next RIP Save.  This feature causes the processor
to store the next sequential RIP of a guest in the VMCB on
most instruction interrupts.  The hypervisor can use this
information to determine how much memory to read to determine
the intercepted instruction, modestly improving performance.
The following patch implements support for this feature.

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
17 years agoFix SCHEDOP_poll to avoid wakeup-waiting race on interrupt delivery.
Keir Fraser [Thu, 16 Oct 2008 17:36:43 +0000 (18:36 +0100)]
Fix SCHEDOP_poll to avoid wakeup-waiting race on interrupt delivery.

Race found by Jan Beulich.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxmalloc: Add pooled allocator interface.
Keir Fraser [Thu, 16 Oct 2008 14:46:04 +0000 (15:46 +0100)]
xmalloc: Add pooled allocator interface.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxmalloc: use tlsf algorithm
Keir Fraser [Thu, 16 Oct 2008 10:09:50 +0000 (11:09 +0100)]
xmalloc: use tlsf algorithm

This patch replaces the Xen xmalloc engine with tlsf, an allocation
engine that is both more space efficient and time-bounded, especially
for allocation sizes between PAGE_SIZE/2 and PAGE_SIZE.

The file xmalloc.c is deprecated but not yet deleted.  A simple
changein common/Makefile will change back to the legacy xmalloc/xfree
if needed for testing.

Code adapted from Nitin Gupta's tlsf-kmod, rev 229, found here:
http://code.google.com/p/compcache/source/browse/trunk/sub-projects/allocat=
ors/tlsf-kmod
with description and performance details here:
http://code.google.com/p/compcache/wiki/TLSFAllocator
(new Xen code uses 4K=3DPAGE_SIZE for the region size)

For detailed info on tlsf, see:
http://rtportal.upv.es/rtmalloc/

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovmx: set DR7 via DOMCTL_setvcpucontext
Keir Fraser [Thu, 16 Oct 2008 08:52:40 +0000 (09:52 +0100)]
vmx: set DR7 via DOMCTL_setvcpucontext

This patch is needed for a guest domain debugger
to support hardware watchpoint.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoxentrace: trace power management events.
Keir Fraser [Thu, 16 Oct 2008 08:51:42 +0000 (09:51 +0100)]
xentrace: trace power management events.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
17 years agoEnhance XenAPI for pvSCSI
Keir Fraser [Thu, 16 Oct 2008 08:50:18 +0000 (09:50 +0100)]
Enhance XenAPI for pvSCSI

Basically, I implemented XenAPI for pvSCSI according to the patch of
XenAPI document which I sent before.  However, I renamed the class
name of virtual SCSI devices to "DSCSI".

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years ago[IA64] rename struct viosapic_rte in order to share VTD code.
Isaku Yamahata [Thu, 16 Oct 2008 02:33:05 +0000 (11:33 +0900)]
[IA64] rename struct viosapic_rte in order to share VTD code.

VTD code uses vioapic_redir_entry structure,
This patch lets viosapci.h use the same structure name and some fields.
That IA64 can use the same VTD code with ia32

Signed-off-by: Anthony xu <anthony.xu@intel.com>
17 years ago[IA64] avoid name conflict with pci_dev.
Isaku Yamahata [Thu, 16 Oct 2008 02:33:05 +0000 (11:33 +0900)]
[IA64] avoid name conflict with pci_dev.

VTD introduces a new pci_dev structure which is conflict with that defined in
xen/include/asm-ia64/linux-xen/linux/linux-pci.h.

the pci_dev defined in linux-pci.h is only used by sn platform.
So change pci_dev to sn_pci_dev.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
17 years agox86 cpuid: leaf 4 sub-index goes in %ecx, not %ebx
Keir Fraser [Wed, 15 Oct 2008 14:58:09 +0000 (15:58 +0100)]
x86 cpuid: leaf 4 sub-index goes in %ecx, not %ebx

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoamd: fix CPUID mask option handling
Keir Fraser [Wed, 15 Oct 2008 14:57:20 +0000 (15:57 +0100)]
amd: fix CPUID mask option handling

c/s 18402 added command line options to AMD-specific code duplicating
ones already existing in Intel code. The generic command line parser
didn't support this scenario for integer options, however.

Additionally, the options added were using the same option string for
two different purposes.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: make injection of spurious page faults configurable per domain
Keir Fraser [Wed, 15 Oct 2008 14:56:26 +0000 (15:56 +0100)]
x86: make injection of spurious page faults configurable per domain

Some distro kernels do not handle spurious page faults so allow these
to be supressed on a per VM basis.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
17 years agovt-d: Fix MSI-x interrupt remapping
Keir Fraser [Wed, 15 Oct 2008 10:58:15 +0000 (11:58 +0100)]
vt-d: Fix MSI-x interrupt remapping

MSI-x may have multiple vectors, however in current interrupt
remapping code, one device only has one entry in interrupt remapping
table.

This patch adds 'remap_index' in msi_desc structure to track its index
in interrupt remapping table.

Signed-off-by: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agox86: Fix non-debug build.
Keir Fraser [Wed, 15 Oct 2008 07:22:42 +0000 (08:22 +0100)]
x86: Fix non-debug build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86_emulate: Fix after decode changes. Valid opcode decode values must
Keir Fraser [Tue, 14 Oct 2008 18:19:48 +0000 (19:19 +0100)]
x86_emulate: Fix after decode changes. Valid opcode decode values must
be non-zero.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoiommu: Fix the build.
Keir Fraser [Tue, 14 Oct 2008 10:49:08 +0000 (11:49 +0100)]
iommu: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoMissing file from prev c/s
Keir Fraser [Tue, 14 Oct 2008 10:29:46 +0000 (11:29 +0100)]
Missing file from prev c/s

17 years agoiommu: Move some 'boot_cpu_data.x86_vendor' related stuff into
Keir Fraser [Tue, 14 Oct 2008 10:29:14 +0000 (11:29 +0100)]
iommu: Move some 'boot_cpu_data.x86_vendor' related stuff into
arch-specific directory.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agovtd: Define msi_msg_{read,write}_remap_rte() to nothing for ia64.
Keir Fraser [Tue, 14 Oct 2008 10:28:37 +0000 (11:28 +0100)]
vtd: Define msi_msg_{read,write}_remap_rte() to nothing for ia64.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoAdd documentation on how to build one's own stub domain kernel
Keir Fraser [Tue, 14 Oct 2008 10:12:02 +0000 (11:12 +0100)]
Add documentation on how to build one's own stub domain kernel

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
17 years agovt-d: Fix comment typos.
Keir Fraser [Tue, 14 Oct 2008 10:10:46 +0000 (11:10 +0100)]
vt-d: Fix comment typos.

Signed-off-by: Ameya Palande <2ameya@gmail.com>
17 years agohvm: Battery Management virtual firmware and toolstack changes
Keir Fraser [Tue, 14 Oct 2008 10:08:15 +0000 (11:08 +0100)]
hvm: Battery Management virtual firmware and toolstack changes

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
17 years agox86, hvm: Hyper-V guest interface support with small set of enlightenments
Keir Fraser [Tue, 14 Oct 2008 09:45:29 +0000 (10:45 +0100)]
x86, hvm: Hyper-V guest interface support with small set of enlightenments

A minimal implementation of the Viridian (Hyper-V) guest
interface. The only enlightenments advertised and supported are vAPIC
MSRs and long-spin-wait notifications. The set of enlightenments can
easily be extended in future, as they are found to provide a
performance win, and configured via an extended HVM_PARAM_VIRIDIAN hvm
parameter.

Signed-off-by: Peter Johnston <peter.johnston@citrix.com>
Signed-off-by: Tim Deegan <tim.deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: propagate return value of alloc_l1_table()
Keir Fraser [Mon, 13 Oct 2008 12:15:20 +0000 (13:15 +0100)]
x86: propagate return value of alloc_l1_table()

A blatant mistake of mine resulted in the return value of
alloc_l1_table() to be ignored with the preemptable page table update
changes.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agovtd: move some x86-dependent functions into x86-specific directory.
Keir Fraser [Mon, 13 Oct 2008 09:09:09 +0000 (10:09 +0100)]
vtd: move some x86-dependent functions into x86-specific directory.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoxend: fixup the Secondary Bus Reset.
Keir Fraser [Mon, 13 Oct 2008 09:08:36 +0000 (10:08 +0100)]
xend: fixup the Secondary Bus Reset.

Use the read-modify-write operation.
Change the wrong 'I' to a correct 'H'.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>